<div id="viewer_friends"> </div>
<script type="text/javascript">

function <? echo $data_response->getJSFunction()->getName() ?>(<? echo $data_response->getJSFunction()->getArgs() ?>) 
{
  var html = '';
  <?php echo $data_response->getData($people_request); ?>
  
  <?php $person = new OSFriend('person'); ?>
  <?php echo $viewer_friends->getVarName() ?>.each(function(<?php echo $person->getVarName() ?>) {
    var thumb = <?php echo $person->getField(OSPersonField::THUMBNAIL_URL); ?>
    var profile = <?php echo $person->getField(OSPersonField::PROFILE_URL); ?>
    html += '<a href="' + profile + '" target="_top" style="float:left">' +'<img src="' + thumb + '"/></a>'; 
    document.getElementById('viewer_friends').innerHTML = html;
  });
}
</script>

